home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / mod2tutb.zip / REALTRIG.MOD < prev    next >
Text File  |  1989-01-18  |  746b  |  38 lines

  1.                                          (* Chapter 3 - Program 5 *)
  2. MODULE RealTrig;
  3.  
  4. FROM InOut IMPORT WriteString, WriteLn;
  5. FROM RealInOut IMPORT WriteReal;
  6. FROM MathLib0 IMPORT sin, cos, entier, real; (* Your system may use
  7.                                   a different name for either the
  8.                                   module or the functions.        *)
  9.  
  10. VAR A, B  : REAL;
  11.     Index : INTEGER;
  12.  
  13. BEGIN
  14.  
  15.    A := 0.5;
  16.    B := sin(A)*cos(A);
  17.  
  18.    WriteString("The Trig values are ");
  19.    WriteReal(A,12);
  20.    WriteString("  ");
  21.    WriteReal(B,12);
  22.    WriteLn;
  23.  
  24.    Index := entier(14.0 * A);
  25.    A := real(Index);
  26.  
  27. END RealTrig.
  28.  
  29.  
  30.  
  31.  
  32. (* Result of execution
  33.  
  34. The Trig values are  5.0000E-001   4.2074E-001
  35.  
  36. *)
  37.  
  38.